<?php

error_reporting(E_ALL);

if (!defined("PHPUnit_MAIN_METHOD")) {
    define("PHPUnit_MAIN_METHOD", "McpTest::main");
}

require_once "PHPUnit2/Framework/TestCase.php";
require_once "PHPUnit2/Framework/TestSuite.php";

/* dependencies for EE */
global $REGX, $PREFS, $DB, $GBL, $IN, $EXT, $FNS, $LOC, $LANG, $SESS, $DSP, $OUT, $BM;

include_once "systempath.php";

if(empty($system_path)) // couldn't read the include file
{
	if (eregi("win", PHP_OS)) 
	{
		$system_path = "c:/NCEIntranet/build/intranet/system/";    
	}
	else
	{
		$system_path = "/var/www/ee/intranet_webdev/system/";
	}
}

$tmp = $system_path;

$ext = ".php";
define("EXT", $ext); // needed for the module class to load

require_once $system_path."config.php";

ob_start();
require_once $system_path."core/core.system.php";
ob_end_clean();

$DB = new DB($db_config);
$LANG->fetch_language_file('ncb_rooms');

$system_path = $tmp;

require_once $system_path."modules/weblog/mod.weblog.php";
require_once "mcp.ncb_rooms.php";

/**
 * Test class for Control Panel
 */
class McpTest extends PHPUnit_Framework_TestCase 
{

	var $control_panel = null;

	public static function main()
	{
		require_once "PHPUnit2/TextUI/TestRunner.php";

		$suite  = new PHPUnit_Framework_TestSuite("McpTest");
		$result = PHPUnit_TextUI_TestRunner::run($suite);
	}


	protected function setUp()
	{
		$this->control_panel = new Ncb_rooms_CP(false);
	}

	protected function tearDown()
	{
		$this->control_panel = null;
	}


	function test_xxx()
	{
//		global $DSP;
//		$DSP->body = null;
//		$_GET['T'] = 'profile';
//		$_GET['ID'] = 1;
//		$this->module_obj->delete_entry_confirm(1);
//		$this->assertEquals(1,substr_count($DSP->body,"P=delete&amp;T=profile&amp;ID=1"));
	}
	

}

// Call main() if this source file is executed directly.
if (PHPUnit_MAIN_METHOD == "McpTest::main") {
    McpTest::main();
}
?>
